package com.lagou.service2.impl;

import com.lagou.common.Common;
import com.lagou.service.HelloService;
import org.apache.dubbo.config.annotation.Service;
import org.apache.dubbo.rpc.RpcContext;

@Service
public class HelloServiceImpl implements HelloService {

    @Override
    public String sayHello(String name) {
        String ip = RpcContext.getContext().getAttachment(Common.REQUEST_IP);
        System.out.println("请求ip:" + ip);
        return "hello:"+name;
    }
}
